package com.itheima.array;

public class ArrayMax {
    public static void main(String[] args) {
        int[] arr = {12, 45, 98, 26, 76};
        int max = arr[0];//参照物很重要 尽量不要用赋值 而是用数组中已给的值

        for (int i = 1; i < arr.length; i++) {
            if (arr[i] > max) {
                max = arr[i];
            }
        }
        System.out.println(max);
    }

}
